# Recipe created by recipetool
# This is the basis of a recipe and may need further editing in order to be fully functional.
# (Feel free to remove these comments when editing.)

# Unable to find any files that looked like license statements. Check the accompanying # documentation and source headers and set LICENSE and LIC_FILES_CHKSUM accordingly.
#
# NOTE: LICENSE is being set to "CLOSED" to allow you to at least start building - if
# this is not accurate with respect to the licensing of the software being built (it
# will not be in most cases) you must specify the correct value before using this
# recipe for anything other than initial testing/development!
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = ""

SRC_URI = "git://e.coding.net/elegrp-rd02/hvac-research/hvac-research.git;protocol=https;branch=feature/protobus;user=rd178%40elegrp.com:1qaz_OKM"

# Modify these as desired
PV = "1.0+git${SRCPV}"
SRCREV = "${AUTOREV}"

S = "${WORKDIR}/git"


DEPENDS += "zeromq"
RDEPENDS_${PN} += "zeromq"

DEPENDS += "cppzmq"
RDEPENDS_${PN} += "cppzmq"

DEPENDS += "protobuf"
RDEPENDS_${PN} += "protobuf"

DEPENDS += "protobuf-c"
RDEPENDS_${PN} += "protobuf-c"

inherit cmake
inherit systemd

# Specify any options you want to pass to cmake using EXTRA_OECMAKE:
EXTRA_OECMAKE = ""

do_configure() {
	bbplain "do_configure S ${S}"
	bbplain "do_configure D ${D}"
	cd ${S}
	if [ -d ${S}/build ]; then
		rm ${S}/build -r
	fi
	mkdir build
	cd build
	cmake -DCMAKE_BUILD_TYPE=Debug -Dyocto_compile=ON -DCMAKE_INSTALL_PREFIX=${D} ..
}

do_compile() {
	cd ${S}/build
	make
}

do_install() {
	bbplain "do_install"
	cd ${S}/build
	bbplain "start install d ${D}/usr/local/bin"
	install -d ${D}/usr/local/bin
	bbplain "start install d ${D}/usr/local/lib"
	install -d ${D}/usr/local/lib
	make install	
}
do_cleanall() {
	bbplain "do_cleanall"
	if [ -d ${S} ]; then
		cd ${S}
		rm ${S}/build -r
	fi
}
FILES:${PN} = "\
             /usr/local/bin   \
             /usr/local/lib   \"
INSANE_SKIP_${PN} += "installed-vs-shipped"
#INSANE_SKIP_${PN}-dbg += "libdir"
#INSANE_SKIP_${PN} += " libdir"
#INSANE_SKIP_${PN} += " dev-so"
#INSANE_SKIP_${PN} += " already-stripped"
#INSANE_SKIP_${PN} += " ldflags"
INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_SYSROOT_STRIP = "1"
SOLIBS = ".so"
FILES_SOLIBSDEV = ""

